# Copyright(c) 2008 Tri Tech Information Systems Inc. 
# Distributed under the Boost Software License, Version 1.0.
#     (See accompanying file ../../LICENSE_1_0.txt or copy at
#           http://www.boost.org/LICENSE_1_0.txt)
#     
ParseHeaderFile("llvm/Function.h")

AddIncludedFile("llvm/SymbolTable.h" )
AddIncludedFile("llvm/Assembly/AsmAnnotationWriter.h")

Import( "GlobalValue.pyx" )
Import( "Support_Annotation.pyx" )

Function = CreateClassWrapper( "llvm::Function" , noncopyable = True)
Function.excludeMethod('viewCFG')
Function.excludeMethod('viewCFGOnly')

code = """
list arg_list(Function & function)
{
    list l;
    for(Function::arg_iterator iter = function.arg_begin();
        iter != function.arg_end();
        iter++)
    {
        l.append(handle_ptr(&*iter));
    }
    return l;
}
"""
Function.addHeaderExtra(code)
Function.addExtra('def("args", &arg_list);')
